home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.DisplayObject;
- import flash.display.DisplayObjectContainer;
- import flash.display.MovieClip;
-
- [Embed(source="/_assets/assets.swf", symbol="PowerupSlot")]
- public class PowerupSlot extends MovieClip
- {
-
-
- internal var _powerup:Powerup = null;
-
- public function PowerupSlot()
- {
- _powerup = null;
- super();
- }
-
- public static function extractFromStage(param1:DisplayObjectContainer) : Array
- {
- var _loc2_:int = 0;
- var _loc3_:Array = null;
- var _loc4_:DisplayObject = null;
- _loc2_ = 0;
- _loc3_ = new Array();
- _loc2_ = 0;
- while(_loc2_ < param1.numChildren)
- {
- if((_loc4_ = param1.getChildAt(_loc2_)) is PowerupSlot)
- {
- _loc3_.push(_loc4_);
- }
- _loc2_++;
- }
- _loc3_.sortOn("name");
- return _loc3_;
- }
-
- public function get AttachedPowerup() : Powerup
- {
- return _powerup;
- }
-
- public function removePowerup() : void
- {
- if(_powerup != null)
- {
- removeChild(_powerup);
- _powerup = null;
- }
- }
-
- public function attachPowerup(param1:Powerup) : void
- {
- removePowerup();
- _powerup = param1;
- param1.scaleX = 1;
- param1.scaleY = 1;
- param1.x = 0;
- param1.y = 0;
- addChild(param1);
- }
- }
- }
-